package com.example.demo.producer;

import java.util.Scanner;

/**
 * @Author xiao
 * @Date 2025/5/6 下午 7:10
 * @ClassName: demo
 * @Desc:
 */
public class demo {
    public static void main(String[] args) {
        //Scanner sc = new Scanner(System.in);
        int num = 1234567; // 获取输入的数字

        //定义 reverse 函数 接收一个参数 num

        //调用 reverse 函数
        reverse(num);

    }

    public static void reverse(int num){
        char[] chars = String.valueOf(num).toCharArray();
        for(int i = 0; i < chars.length/2 ; i ++) {
            int  j = chars.length - i -1 ;

            char tem = chars[j];
            chars[j] = chars[i];
            chars[i] = tem;
        }
        System.out.println(new String(chars));
    }

}

